=begin
Ruby FFI bindings for the Perseus library

Information on FFI are available at https://github.com/ffi/ffi
To install FFI just do "gem install ffi" in your command shell

=end

require 'ffi'

module Perseus
  extend FFI::Library

  ffi_lib '../libperseus-1.0.3.so'
  ffi_convention :stdcall

  
  class LibPerseus_hl_t < FFI::Struct
    layout :Pcc, :pointer,
	       :NGen, :pointer,
		   :aKey, :pointer
  end
  

  attach_function :init, :perseus_init, [:pointer, :float, :float, :float, :float], :int
  attach_function :code, :perseus_code, [:pointer, :pointer, :ulong, :pointer], :pointer
  attach_function :decode, :perseus_decode, [:pointer, :pointer, :ulong, :pointer], :pointer
  attach_function :destroy, :perseus_destroy, [:pointer], :void
  
  
end
